package at.chl.lution.factory;

import java.util.ArrayList;
import java.util.List;

import sun.security.provider.MD5;

import at.chl.genetic.node.IDecisionNode;
import at.chl.genetic.random.IRandomDecisionNodeFactory;
import at.chl.lution.BasicLutionist;
import at.chl.lution.ILutionist;

public class BasicLutionistFactory {
	
	private static Long idCount=1l;

	public static List<ILutionist> createPopulation(Long populationSize,
			IRandomDecisionNodeFactory nodeFactory) {
		
		List<ILutionist> population=new ArrayList<ILutionist>();
		
		for(int i=0;i<populationSize;i++){
			population.add(createBasicLutionist(nodeFactory.createDecisionTree()));
		}
		
		
		return population;
	}

	public static ILutionist createBasicLutionist(
			IDecisionNode rootNode) {
		ILutionist lutionist=new BasicLutionist();
		lutionist.setDecisionRootNode(rootNode);
		lutionist.setId(idCount++);
		lutionist.setName("#"+lutionist.getId());//createBasicName(lutionist.getDecisionRootNode()));
		return lutionist;
	}

	private static String createBasicName(IDecisionNode node) {
		//implement logic (in factory?) to create a label nam from nodetreenamescompression
		return null;
	}

	

}
